<?php

/**
 * WebUser class
 *
 * @author Julot <andy.julot@gmail.com>
 * @since Thursday, June 30, 2011. 06:22 PM
 */
class WebUser extends CWebUser {

	public function getMenu() {
		$user = Yii::app()->user;
		return array(
			array(
				'label'=>'Pemeliharaan Berita',
				'url'=>array('news/admin'),
				'visible'=>$user->checkAccess('newsManage'),
			),
//			array(
//				'label'=>'Input Anggota Belum Punya KTA',
//				'url'=>array('member/create', 'type'=>0),
//				'visible'=>$user->checkAccess('memberCreate'),
//			),
//			array(
//				'label'=>'Input Anggota Sudah Punya KTA',
//				'url'=>array('member/create', 'type'=>1),
//				'visible'=>$user->checkAccess('memberCreate'),
//			),
//			array(
//				'label'=>'Pemeliharaan Anggota',
//				'url'=>array('member/admin'),
//				'visible'=>$user->checkAccess('memberManage'),
//			),
//			array(
//				'label'=>'Permintaan KTA',
//				'url'=>array('cardreq/create'),
//				'visible'=>$user->checkAccess('cardreqCreate'),
//			),
			array(
				'label'=>'Tambah Kantor',
				'url'=>array('office/create'),
				'visible'=>$user->checkAccess('officeCreate'),
			),
			array(
				'label'=>'Pemeliharaan Kantor',
				'url'=>array('office/admin'),
				'visible'=>$user->checkAccess('officeManage'),
			),
			array(
				'label'=>'Tambah Pengguna',
				'url'=>array('user/create'),
				'visible'=>$user->checkAccess('userCreate'),
			),
			array(
				'label'=>'Pemeliharaan Pengguna',
				'url'=>array('user/admin'),
				'visible'=>$user->checkAccess('userManage'),
			),
			array(
				'label'=>'Pemeliharaan Hak Akses',
				'url'=>array('user/index'),
				'visible'=>$user->checkAccess('userList') &&
				$user->checkAccess('userView') &&
				$user->checkAccess('userRbac'),
			),
			array(
				'label'=>'Pemeliharaan Slideshow Pemantauan',
				'url'=>array('slideshow/admin'),
				'visible'=>$user->checkAccess('slideshowManage'),
			),
			array(
				'label'=>'Pemeliharaan Blacklist',
				'url'=>array('blacklist/admin'),
				'visible'=>$user->checkAccess('blacklistManage'),
			),
			array(
				'label'=>'Pemeliharaan Sensor',
				'url'=>array('censor/admin'),
				'visible'=>$user->checkAccess('censorManage'),
			),
			array(
				'label'=>'Pemeliharaan Kantor',
				'url'=>array('office/admin'),
			),
			array(
				'label'=>'Pemeliharaan Kota',
				'url'=>array('city/admin'),
			),
			array(
				'label'=>'Administrasi KTA',
				'url'=>array('printing/index'),
			),
			array(
				'label'=>'Pemeliharaan Propinsi',
				'url'=>array('province/admin'),
			),
			array(
				'label'=>'Ganti Password',
				'url'=>array('user/updatePassword'),
			),
			array(
				'label'=>"Logout (" . $this->name . ")",
				'url'=>array('site/logout'),
			),
		);
	}

}
